<template>
	<view class="content">
      <button type="primary" v-for="(item, index) in roomList" :key="item" @tap = "joinRoom(item, index)">{{item.name}}</button>
	</view>
</template>

<script lang="ts">
  import Vue from 'vue';
	import {mapState, mapGetters} from 'vuex';

	export default Vue.extend({
		data() {
			return {

			}
		},
		onLoad() {
			console.log(this.timReady)
		},
		computed: {
			...mapGetters(['roomList', 'timReady'])
		},
		methods: {
			joinRoom (item, index) {
				console.log('index:'+index)
				uni.redirectTo({
					url: '/pages/room/index?index='+ index
				});
			}
		}
	});
</script>

<style>
	.content {
		text-align: center;
		height: 400upx;
	}
    .logo{
        height: 200upx;
        width: 200upx;
        margin-top: 200upx;
    }
	.title {
		font-size: 36upx;
		color: #8f8f94;
	}
</style>
